package ch.abcm.remsmobile.REMSMobile;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import ch.abcm.remsmobile.REMSMobile.multicastreceiver.REMSMulticastReceiver;
import ch.bfh.abch.rems.REMSMulticastController;

public class StartupJob extends BroadcastReceiver{
    
    private static final String TAG = "StartupJob";

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d(TAG, "Received Intent: "+ intent.getAction());
        // We dont start the network now
        //startNetwork(context);
        startMulticastReceiver(context);
    }

	private void startMulticastReceiver(Context context) {
		Log.d(TAG, "Start MulticastReceiver");
		new REMSMulticastController().startMulticastReceiver(new REMSMulticastReceiver(context));
		
	}

//	private void startNetwork(Context context) {
//		Intent startNetwork = NetworkController.getStartIntent();
//        Log.d(TAG, "Send startNetwork Intent");
//        context.sendBroadcast(startNetwork);
//	}

}
